class_name UnitGargoyle
extends UnitBase

var move_target: Node2D


func process_wander(delta: float):
	return
	
	
func play_wander_animation():
	animation_player.play("idle")


func _on_recover_approach_timer_timeout() -> void:
	states.transition("Approach")


func on_hit(target: Node2D):
	if not target is UnitBase: return
	
	target = target as UnitBase
	var unit_config = unit_data.config as UnitBaseConfig
	
	var numb_hit_rate = unit_config.numb_debuff_hit_rate 
	var is_hit = randf() < numb_hit_rate
	if is_hit and not target.get_buff_by_name("debuff_numb"):
		var buff_inst = target.add_buff("debuff_numb", self)
		
		buff_inst.numb_speed_scale = unit_config.numb_speed_scale
		buff_inst.duration = unit_config.numb_debuff_duration
		buff_inst.sender = self
		buff_inst.start_buff()
	
